package org.mashibing.util;

/**
 * @author:
 * @create: 2024/3/29 13:36
 * @description: 设置Redis的Key前缀
 */
public class RedisPrefixUtil {

    /**
     * 乘客验证码前缀
     */
    public static String verificationCodePrefix = "verification-code-";
    /**
     * 乘客token前缀
     */
    public static String passengerTokenPrefix = "token-";

    /**
     * 根据手机号生成redis的key
     */
    public static String generatorKeyByPhone(String phone, String identity){
        return verificationCodePrefix + identity + "-" + phone;
    }

    /**
     * 根据手机号生成乘客token的key
     */
    public static String generatorTokenKey(String phone,String identity,String tokenType){
        return passengerTokenPrefix + phone + "-" + identity + "-"  + tokenType;
    }
}
